<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to CheapCheep!</title>

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<script type="text/javascript">
function checkForm()  {
	var msg = "";
	
	//check to make sure the user entered a valid email address
	var emailStr = document.getElementById("email").value;  
    var emailRegexStr = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
    var isvalid = emailRegexStr.test(emailStr); 
	if (!isvalid)  {
		msg += "Invalid Email Address\n";
		document.getElementById("email").focus();
	}
	
	//check for blank fields
	if (document.getElementById("email").value == "")  {
		msg += "Email is blank\n"
	}
	if (document.getElementById("password1").value == "")  {
		msg += "Password1 is blank\n"
	}
	if (document.getElementById("password2").value == "")  {
		msg += "Password2 is blank\n";
	}
	if (document.getElementById("zipCode").value == "")  {
		msg += "Zip Code is blank\n";
	}
	
	//get the two passwords
	var pass1 = document.getElementById("password1").value;
	var pass2 = document.getElementById("password2").value;
	//check if the passwords are the same
	if (pass1 != pass2)
		msg += "Passwords do not match\n";
		
	//of nothing was added to msg, then everything is filled out correctly
	if (msg.length < 1)  {
		alert ("true");
		return true;
	}
	//otherwise, alert the user of what is not filled out correctly
	alert(msg);
	return false;
}

</script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="cheapstyle.css" rel="stylesheet" type="text/css" />
</head>

<body bgcolor="#0FA1B8">
<table width="100%" border="0" align="center" cellspacing="5">
  <tr>
    <td width="64%" height="195"><a href="index.html"><img src="images/sdf.png" width="155" height="164" align="left" /></a>      <p class="Header" align="center">&nbsp;</p></td>
    <td width="36%" align="right" ><table width="300" border="0">
      <tr align="left">
        <td>
        <!-- LOGIN FORM STARTS HERE  (NEEDS TO BE DONE IN PHP) --->
        <p class="Header" align="center"><strong>Login </strong></p>
          <form id="form1" name="form1" method="post" action="">
            <strong>
            <label for="username3"> <span class="regtext">&nbsp; Username:</span></label>
            <span class="regtext">
              <input name="username" type="text" id="username3" size="20" />
              <label for="password"> <br />
                &nbsp; Password</label>
              <label for="password">:</label>
              <input name="password" type="password" id="password" size="20" />
              <br />
              </span>
            <input type="submit" name="login" id="login" value="Login" />
            </strong>
          </form>
          <strong><br />
          </strong>
          <p class="linkies"><strong><span class="regtext">Don't have an account?</span> <a href="register.html">Click here to register! </a></strong><a href="register.html"></a></p>
          <!-- Login Form ends here-->
          </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#EAEAEA" class="linkies"><ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a class="MenuBarItemSubmenu" href="#">Find Deals</a>
        <ul>
          <li><a href="#">By Location</a></li>
          <li><a href="#">By Category</a></li>
          <li><a href="#">Search</a></li>
        </ul>
      </li>
      <li><a href="#">Post Deals</a></li>
      <li><a class="MenuBarItemSubmenu" href="#">Link1</a>
        <ul>
          <li><a href="#">Link11</a>            </li>
          <li><a href="#">Link12</a></li>
          <li><a href="#">Link13</a></li>
        </ul>
      </li>
      <li><a href="#">Link2</a></li>
    </ul></td>
  </tr>
  <tr>
    <td height="379" colspan="2" align="center" class="linkies">
    
    <!-- Start Main Section -->
    <table width="80%"  height="379" border="0" cellpadding="5" cellspacing="0" style="font-size:16px">
      <form method="post" onSubmit="return checkForm()" action="newuser.php" id="dealform">
      <tr>
        <td align="right" valign="top" bgcolor="#EAEAEA">Email Address</td>
        <td align="left" valign="top" bgcolor="#EAEAEA">
        	<input type="text" id="email" name="email" />
        </td>
      </tr>
      <tr>
        <td align="right" valign="top" bgcolor="#EAEAEA">Password</td>
        <td align="left" valign="top" bgcolor="#EAEAEA">
        	<input type="password" id="password1" name="password1" />
        </td>
      </tr>
      <tr>
        <td align="right" valign="top" bgcolor="#EAEAEA">Retype Password</td>
        <td align="left" valign="top" bgcolor="#EAEAEA">
        	<input type="password" id="password2" name="password2" />
        </td>
      </tr>
      <tr>
        <td align="right" valign="top" bgcolor="#EAEAEA">Preferred Zip Code</td>
        <td align="left" valign="top" bgcolor="#EAEAEA">
        	<input type="text" id="zipCode" name="zipCode" />
        </td>
      </tr>
      <tr>
        <td align="right" valign="top" bgcolor="#EAEAEA">
        <input type="reset" /></td>
        <td align="left" valign="top" bgcolor="#EAEAEA">
        	<input type="submit" id="submit" value="Submit" />
        </td>
      </tr>
      
      </form>
</table>
	<!-- End Main Section -->
	</td>
  </tr>
  <tr>
    <td colspan="2" align="center" class="linkies"><table width="584" border="0">
      <tr>
        <td bgcolor="#EAEAEA" class="Footies">About CheapCheep - Terms of Service - Privacy Policy - Safety Tips - Contact Us</td>
      </tr>
    </table></td>
  </tr>
</table>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>
